//
//  CarMessageViewController.m
//  carSecretary
//
//  Created by huangliru on 14-9-9.
//  Copyright (c) 2014年 huangliru. All rights reserved.
//

#import "CarMessageViewController.h"

@interface CarMessageViewController ()

@end

@implementation CarMessageViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    //创建一个导航栏
    UINavigationBar *bar = [[UINavigationBar alloc]initWithFrame:CGRectMake(0, 18, 320, 44)];
    //创建一个导航栏集合
    UINavigationItem *navigationItem = [[UINavigationItem alloc] initWithTitle:nil];
    //创建一个左边按钮
    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleBordered target:self action:@selector(backButton)];
    //设置导航栏内容
    [navigationItem setTitle:@"车辆状态"];
    //把导航栏集合添加入导航栏中，设置动画关闭
    [bar pushNavigationItem:navigationItem animated:NO];
    //把左按钮添加入导航栏集合中
    [navigationItem setLeftBarButtonItem:leftButton];
    bar.backgroundColor = [UIColor grayColor];
    [self.view addSubview:bar];
    
    UILabel *lable1 = [[UILabel alloc]initWithFrame:CGRectMake(10, 100, 100, 40)];
    lable1.text = @"设备电量：";
    lable1.textColor = [UIColor blackColor];
    [self.view addSubview:lable1];
    
    UILabel *lable2 = [[UILabel alloc]initWithFrame:CGRectMake(10, 180, 100, 40)];
    lable2.textColor = [UIColor blackColor];
    lable2.text = @"G P S    ：";
    [self.view addSubview:lable2];
    
    UILabel *lable3 = [[UILabel alloc]initWithFrame:CGRectMake(100, 180, 45, 40)];
    lable3.textColor = [UIColor blackColor];
    lable3.text = @"经度";
    [self.view addSubview:lable3];
    
    UILabel *lable4 = [[UILabel alloc]initWithFrame:CGRectMake(100, 260, 45, 40)];
    lable4.textColor = [UIColor blackColor];
    lable4.text = @"纬度";
    [self.view addSubview:lable4];
    
    UILabel *lable5 = [[UILabel alloc]initWithFrame:CGRectMake(10, 311, 100, 40)];
    lable5.textColor = [UIColor blackColor];
    lable5.text = @"烟       感：";
    [self.view addSubview:lable5];
    
    UILabel *lable6 = [[UILabel alloc]initWithFrame:CGRectMake(10, 402, 100, 40)];
    lable6.textColor = [UIColor blackColor];
    lable6.text = @"温       度：";
    [self.view addSubview:lable6];
    
    UILabel *lable7 = [[UILabel alloc]initWithFrame:CGRectMake(10, 483, 100, 40)];
    lable7.textColor = [UIColor blackColor];
    lable7.text = @"设备流量：";
    [self.view addSubview:lable7];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

// 导航栏返回按钮
-(void)backButton
{
    [self dismissViewControllerAnimated:NO completion:nil];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
